package com.example.design.bilibili.observer;

public class CurrentConditions implements Observer{

    private float temperature;

    private float pressure;

    private float humidity;

    @Override
    public void update(float temperature, float pressure, float humidity) {
        this.temperature = temperature;
        this.pressure = pressure;
        this.humidity = humidity;
        display();
    }

    //显示
    public void display(){
        System.out.println("***today temperature is "+temperature+"***");
        System.out.println("***today pressure is "+pressure+"***");
        System.out.println("***today humidity is "+humidity+"***");
    }
}
